Skip to content

fix(text): align right-to-left text to the right on web - #5265

Merged
Doberjohn merged 2 commits into
mainfrom
@Doberjohn/text-rtl-align-web
Nov 20, 2026
Merged

Doberjohn merged 2 commits into
mainfrom
@Doberjohn/text-rtl-align-web

Conversation

@Doberjohn

@Doberjohn Doberjohn commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

On web in RTL (<html dir="rtl"> plus direction="rtl" on PaperProvider), rows and icons mirror but Text stays left: List.Item titles, List.Subheader, the Appbar title. Text sets textAlign: 'left', which Android and iOS flip in RTL but browsers keep.

On web, Text and AnimatedText now align right when Paper's direction is rtl. Native, left-to-right and a textAlign in style are unchanged. The RTL and migration guides now say so.

Related issue

No issue.

Screenshots / Videos

List.Section on web in RTL, before and after:

before-web-list after-web-list

Test plan

  • The web RTL Text test fails without the change.
  • Example app on web in RTL: List.Section, Card, drawer.

Text and AnimatedText set `textAlign: 'left'`. Android and iOS align that
to the right when the layout is right-to-left, but browsers keep it
physical, so on web List.Item titles, List.Subheader and the Appbar title
stayed on the left in RTL while rows and icons mirrored.

On web, both now align right when Paper's direction is `rtl`. Android,
iOS, left-to-right text and a `textAlign` passed in `style` are unchanged.
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 7c180b1

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
src/components/Typography/Text.tsx:95 Default web RTL text alignment changed with no note in the RTL guide

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (295f36b5e27b).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 7c180b1. The verdict and the full list are in the summary comment.

Comment thread src/components/Typography/Text.tsx Resolved
Text and AnimatedText now take their default alignment from
`getTextAlignStyle` in `Typography/utils.ts`, so the two can't drift
apart. rtl.md and the migration guide's Text section now say that on
web a `Text` under `direction="rtl"` aligns right, and that a
`textAlign` in `style` still wins. Nothing renders differently.
@Doberjohn
Doberjohn merged commit add03a1 into main Nov 20, 2026
14 of 15 checks passed
@Doberjohn
Doberjohn deleted the @Doberjohn/text-rtl-align-web branch November 20, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants